void main(){
//   sayHello('花姐');

//  print( sum(998,68));

//  eatFoods('猪脚饭');
//  eatFoods('猪脚饭',food2: '兰州拉面',drink: '冰红茶');
//  eatFoods('猪脚饭',drink: '绿茶',food2:'剁椒鱼头' );

// sayGoodBye(sayHi);

// 匿名函数
// xxx(function(){});

sayGoodBye((){
  print('你好吗？饿了么');
});

// 箭头函数
sayGoodBye(()=>{
  print('你好吗？饿了么')
});
}


sayHi(){
  print('么么哒');
}

sayHello(String name){
  print('$name,么么哒');
}

sum(int a,int b){
  return a+b;
}

// 必传参数 food1
// 可选参数 {类型 变量名=默认值,类型? 变量名}
eatFoods(String food1,{String? food2,String drink='可乐' }){
  print('$food1,和$food2 和$drink');
}

sayGoodBye(Function howToSay){
  print('要打招呼');
  howToSay();
}